package fangzhiyi_day0321.Arraylist;

import java.util.ArrayList;

/**
 * @author fangzhiyi
 * @version 1.0
 * @date 2025/3/21 11:00
 * @description
 */
public class Arraylist01 {
    public static void main(String[] args) {
        ArrayList<Emp> list = new ArrayList<Emp>();
        list.add(new Emp(1,"小工","计算机",4000,18,"后勤部"));
        list.add(new Emp(2,"小土","计算机",5000,18,"后勤部"));
        list.add(new Emp(3,"小王","计算机",6000,18,"技术部"));
        list.add(new Emp(4,"小玉","计算机",6700,18,"技术部"));
        list.add(new Emp(5,"小干","计算机",3800,18,"后勤部"));
        list.add(new Emp(6,"小十","计算机",7000,18,"技术部"));
        list.add(new Emp(7,"小一","计算机",9000,18,"技术部"));


        for (int i = 0; i < list.size(); i++) {
            if (list.get(i).getSalary()>5000&&list.get(i).getSalary()<=7000){
             list.get(i).setSalary(list.get(i).getSalary()*1.2);
            }
            if ("后勤部".equals(list.get(i).getDept())){
                list.remove(i);
                i--;
            }
        }
        System.out.println(list);
    }

}
